﻿#if __ANDROID__

namespace Outcoder.UI.Xaml
{
	public partial class EnvironmentValues
	{
		static bool? usingEmulator;

		public static bool UsingEmulator
		{
			get
			{
				if (!usingEmulator.HasValue)
				{
					string fingerprint = Android.OS.Build.Fingerprint;

					if (fingerprint != null)
					{
						usingEmulator = fingerprint.Contains("vbox") || fingerprint.Contains("generic");
					}
					else
					{
						usingEmulator = false;
					}
				}
				return usingEmulator.Value;
			}
		}
	}
}
#endif
